<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="srcPath" value="${redis:getSysConfig('sysFileVisitRoot_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<script type="text/javascript">
    /**
     * 查看权限详情
     */
    function detailInfo(id){
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/purview/getPurviewObject.sjson",
            data: {purviewId:id},
            success: function(result){
                var data = JSON.parse(result.data);
                /**重置详情页中所有html展示信息**/
                resetDetailTable("detailTable");
                /**设置展示信息**/
                $("#d_iconUrl").html("<img id='uploadImg_detail_1' class='uploadImg' onMouseOver='showDetailBigImage(1,3,3,0)'  onMouseOut='showDetailRebackImage(1,1,1)' src='${uploadPath}/"+data.iconUrl+"' onerror='this.src=\"${srcPath}/common/images/mrbj.png\"' width='50px' height='50px' />");
                $("#d_purviewName").html(data.purviewName);
                if(data.levelCode=="1"){
                    $("#d_levelCode").html("<font class='color_001'>一级菜单权限</font>");
                }else if(data.levelCode=="2"){
                    $("#d_levelCode").html("<font class='color_002'>二级菜单权限</font>");
                }else if(data.levelCode=="3"){
                    $("#d_levelCode").html("<font class='color_003'>三级菜单权限</font>");
                }
                if(data.isLeaf=="1"){
                    $("#d_isLeaf").html("<font class='color_001'>叶节点</font>");
                }else {
                    $("#d_isLeaf").html("<font class='color_002'>分支节点</font>");
                }
                $("#d_url").html(data.url);
                $("#d_purviewValidateCode").html(data.purviewValidateCode);
                $("#d_sortCode").html(data.sortCode);
            }
        });
    }

</script>

<!--详情模态框（Modal） -->
<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
    <div class="modal-dialog" style="width:70%">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h5 class="modal-title" id="myModalLabel">权限详情</h5>
            </div>
            <div class="modal-body">
                <table id="detailTable" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
                    <tr>
                        <td class="toright_td" width="150px">权限图标:</td>
                        <td class="toleft_td">&nbsp;&nbsp;<span id="d_iconUrl"></span></td>
                    </tr>
                    <tr>
                        <td class="toright_td" width="150px">权限名称:</td><td  class="toleft_td">&nbsp;&nbsp;<span id="d_purviewName"></span></td>
                    </tr>
                    <tr>
                        <td class="toright_td" width="150px">权限级别:</td><td  class="toleft_td">&nbsp;&nbsp;<span id="d_levelCode"></span></td>
                    </tr>
                    <tr>
                        <td class="toright_td" width="150px">节点类型:</td><td  class="toleft_td">&nbsp;&nbsp;<span id="d_isLeaf"></span></td>
                    </tr>
                    <tr>
                        <td class="toright_td" width="150px">权限路径:</td><td  class="toleft_td">&nbsp;&nbsp;<span id="d_url"></span></td>
                    </tr>
                    <tr>
                        <td class="toright_td" width="150px">权限验证编码:</td><td  class="toleft_td">&nbsp;&nbsp;<span id="d_purviewValidateCode"></span></td>
                    </tr>
                    <tr>
                        <td class="toright_td" width="150px">排序号:</td><td  class="toleft_td">&nbsp;&nbsp;<span id="d_sortCode"></span></td>
                    </tr>
                </table>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>